import { defineStore } from 'pinia';

export const template20Store = defineStore('template20Store', {
  state: () => ({
    nullScroll: true,
    ModuleShow: false,
    routeIndex: 0,
    textShow: false,
    text: '',
    childModel: {
      id: 0,
      level: 0,
      number: 0,
      parentId: 0,
      remarks: '',
      sort: 0,
      text: '',
      type: 1,
      value: '',
      children: [],
    },
    childInfo: {
      id: 0,
      level: 0,
      number: 0,
      parentId: 0,
      remarks: '',
      sort: 0,
      text: '',
      type: 1,
      value: '',
      children: [],
    },
  }),
  actions: {
    setchildren(styleInfo: any) {
      this.childInfo = styleInfo;
    },
    setchildModel(styleInfo: any) {
      this.childModel = styleInfo;
    },
    settextShow(e: boolean) {
      this.textShow = e;
    },
    setText(e: any) {
      this.text = e;
    },
  },
  persist: true,
});

export default 'template20Store';
